home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 18
/
AMIGAplus Sonderheft 18 (1999)(ICP)(DE)[!].iso
/
Forum
/
MichaelRoth
/
3-3-99
/
StRwAnDlEr
/
StRwAnDlEr.AsM
< prev
Wrap
Assembly Source File
|
1998-12-29
|
5KB
|
187 lines
; Swapt groß und klein für denn EfEkT hIeR!! :-)
;// Autor
; %
; %%*%%
; %%%* *%%%
; %%%%* B *%%%%
; %%%%%* T *%%%%%
; %%%%%%* B *%%%%%%
; %%%%%%%* 1 *%%%%%%%
; %%%%%%%%* 3 *%%%%%%%%
; *%%%%%%%%%%* M *%%%%%%%%%%*
; %%%%%%%%%%%%*---------------*%%%%%%%%%%%%
; %% A M I G A %%
; %% B i l l y T h e B y t e %%
; %% © 1997 Michael Roth %%
; %%%%%%%%%%%%*---------------*%%%%%%%%%%%%
; *%%%%%%%%%%* D *%%%%%%%%%%*
; %%%%%%%%* A *%%%%%%%%
; %%%%%%%* C *%%%%%%%
; %%%%%%* 6 *%%%%%%
; %%%%%* 9 *%%%%%
; %%%%* 8 *%%%%
; %%%* *%%%
; %%*%%
; %
;\\
;// Include
Include assem:macro/Dir
Include assem:macro/Exec.m
Include assem:macro/Dos.m
Include Dos/DosExtens.i
include macro/filelength
;\\
;// Libraries öffnen
OpenDos 37
;\\
;//ReadArgs
move.l #inputstr,d1 ; Eingabe String
move.l #arry,d2 ; Arry
move.l #0,d3 ; Keine Externe Structur
Dos ReadArgs ; Argumente Lesen
move.l d0,rdargs ; speichern
bne.s .1 ; prüfen ob alles o.k.
error cleanup,20 ; o.k. >.1 Ansonsten Fehlermeldung beenden
.1 ;
lea arry,a0 ; Arry nach a0
;\\
;//File Öffnen und gröe bestimmen
move.l (a0),d1
move.l #MODE_OLDFILE,d2 ; 1005
Dos Open ; File Öffnen
bne.s .2
error cleanup,20
.2
move.l d0,fh
filelength fh,filelänge ; Filelänge bestimmen
;\\
;// Speicher Reservieren
move.l filelänge,d0
move.l #MEMF_CLEAR,d1
Exec AllocMem
move.l d0,memblock
bne.s .memallockok
error cleanup,20
.memallockok
;\\
;// File einlesen
move.l fh,d1
move.l memblock,d2
move.l filelänge,d3
Dos Read
cmp.l filelänge,d0
beq.s .readok
error cleanup,20
.readok
;\\
;// Kernstück
move.l memblock,a0
move.l filelänge,d0
; A0 -> String
; d0 -> Länge des Strings (word)
; d1 - Is Needet for Flag
sub.w #1,d0 ;Wegen DBRA -1...
moveq #0,d1 ;D1 Säubern
btst #5,(a0) ;Testen ob 1 Zeichen im String Groß
beq .loop ;Wenn Ja LOOPEN
move.b 1,d1
.loop
cmp.b #"A",(a0) ;Zeichen zwischen A und
blo.s .next
cmp.b #"Z",(a0) ;z ? Dann weiter
bhi.s .22
bra .go
.22
cmp.b #"a",(a0) ;Zeichen zwischen A und
blo.s .next
cmp.b #"z",(a0) ;z ? Dann weiter
bhi.s .next
.go
cmp.b #1,d1
beq .low
move.b #1,d1
btst #5,(a0)
beq .next ;Ist bereits Klein
bclr #5,(a0) ;Klein machen
bra.s .next
.low
move.b #0,d1
btst #5,(a0)
bne .next ;bereits Klein
bset #5,(a0)
bra.s .next
nop
.next
lea 1(a0),a0
dbra d0,.loop
;\\
;// Zielfile Öffnen
lea arry,a0 ; Arry nach a0
move.l 4(a0),d1
move.l #MODE_NEWFILE,d2
Dos Open
move.l d0,d7
bne .ok
error cleanup,20
.ok
move.l d7,d1
move.l memblock,d2
move.l filelänge,d3
Dos Write
move.l d7,d1
Dos Close
;\\
;// CleanUp
cleanup
move.l rdargs,d1
beq.s .end ; Argumente da ?
Dos FreeArgs ; Wenn Nein beenden
move.l fh,d1
beq.s .1 ; File geöffnet
Dos Close ; Wenn nein weiter
.1
move.l memblock,d0
beq.s .2
move.l d0,a1
move.l filelänge,d0
Exec FreeMem
.2
.end
closedos
moveq #0,d0
rts
;\\
;// Data
DATA
inputstr
dc.b "Source/A,Dest/A",0
BSS
cnop 0,4
arry ds.l 2
rdargs ds.l 1
fh ds.l 1
filelänge
ds.l 1
memblock ds.l 1
insert dc.b 4,0
;\\